package com.example.springhelloworld.services;

import com.example.springhelloworld.mapper.StudentDao;
import com.example.springhelloworld.model.DTO.StudentDTO;
import com.example.springhelloworld.model.VO.StudentVO;
import com.example.springhelloworld.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class StudentServiceImpl implements StudentService{

@Resource
private StudentDao studentDao;


    @Override
    public StudentVO queryById(int id) {
        return studentDao.queryById(id);
    }

    @Override
    public Student queryByName(String name) {
        return studentDao.queryByName(name);
    }



    @Override
    public int addUser(StudentDTO student) {
        StudentDTO student1=new StudentDTO(1,1,1,1,"张三");
        return studentDao.addUser(student1);
    }

    @Override
    public int updateStudent(int id) {
        return studentDao.updateStudent(id);
    }

    @Override
    public int deleteStudent(int id) {
        return studentDao.deleteStudent(id);
    }
}
